A static semantics for Haskell

نویسنده

  • Karl-Filip Faxén
چکیده

This paper gives a static semantics for Haskell 98, a non-strict purely functional programming language. The semantics formally speciies nearly all the details of the Haskell 98 type system, including the resolution of overloading, kind inference (including defaulting) and polymorphic recursion, the only major omission being a proper treatment of ambiguous overloading and its resolution. Overloading is translated into explicit dictionary passing, as in all current implementations of Haskell. The target language of this translation is a variant of the Girard-Reynolds polymorphic lambda calculus featuring higher order polymorphism and explicit type abstraction and application in the term language. Translated programs can thus still be type checked, although the implicit version of this system is impredicative. A surprising result of this formalization eeort is that the monomorphism restriction, when rendered in a system of inference rules, compromises the principal type property.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Static Contract Checking via First-Order Logic

We enrich the static semantics of Haskell in order to give stronger static guarantees about the input/output behavior of programs. Our approach has two parts: a contract system for Haskell, and a novel strategy for statically checking that a term satisfies a contract. The contract system includes refinement types, which refine Haskell types by arbitrary Boolean-valued Haskell expressions, and a...

متن کامل

Region-Based Dynamic Separation for STM Haskell

We present a design and implementation of dynamic separation in STM Haskell. Dynamic separation is a recent approach to software transactional memory (STM) that achieves strongly-atomic semantics with performance comparable to that of a weakly-atomic STM. STM Haskell, a lazy-versioning STM library for Haskell, previously supported strongly-atomic semantics via static separation, and we have fou...

متن کامل

Denotational semantics of ANSI C

The semantics of C is described in the ANSIrISO standard using natural language. This paper contains a brief summary, more descriptive than technical, of our research in specifying a complete and accurate formal semantics for ANSI C. We follow the denotational approach and divide the specification in three distinct phases: static, typing and dynamic semantics. Moreover, we have developed a dire...

متن کامل

A Transformational Approach which Combines Size Inference and Program Optimization

We propose a transformational approach for the static analysis and optimization of functional programs. Size inference accumulates abstract information about the sizes of dynamic data objects, represented in a language of size expressions. Symbolic names are used to deal with sizes or values of input data in which the sizes are to be expressed. After the inference, the size information is used ...

متن کامل

A Haskell-Implementation of STM Haskell with Early Conflict Detection

Software transactional memory treats operations on the shared memory in concurrent programs like data base transactions. STM Haskell integrates this approach in Haskell and provides combinators to build software transactions in a composable way. In previous work we introduced the process calculus CSHF as a formal model for a concurrent implementation of software transactional memory in Concurre...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • J. Funct. Program.

دوره 12  شماره 

صفحات  -

تاریخ انتشار 2002